<?php /* Smarty version Smarty-3.1.18, created on 2015-07-10 22:02:38
         compiled from "D:\WWW\yf_qiaqia\Admin\View\Admin\role.html" */ ?>
<?php /*%%SmartyHeaderCode:25429559fd07e196622-03828649%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '5504ddaa7ddfea28a3161523861847f3ba246dba' => 
    array (
      0 => 'D:\\WWW\\yf_qiaqia\\Admin\\View\\Admin\\role.html',
      1 => 1436171753,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '25429559fd07e196622-03828649',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    '_C' => 0,
    'user_info' => 0,
    'action_list' => 0,
    'act' => 0,
    'kid' => 0,
    'id' => 0,
    '_L' => 0,
    'action' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_559fd07e32ca80_23780560',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_559fd07e32ca80_23780560')) {function content_559fd07e32ca80_23780560($_smarty_tpl) {?><!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="<?php echo $_smarty_tpl->tpl_vars['_C']->value['hy_path'];?>
css/amazeui.min.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo $_smarty_tpl->tpl_vars['_C']->value['hy_path'];?>
css/hy.admin.css" />
	</head>

	<body>
		<div class="am-g">
			<?php echo $_smarty_tpl->getSubTemplate ('../Common/hy_header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

			<div class="am-u-md-8 am-u-end">
				<form class="am-form am-form-horizontal hy-js-form">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">角色名</label>
						<div class="am-u-sm-9">
							<input type="text" name="role_name" value="<?php echo $_smarty_tpl->tpl_vars['user_info']->value['role_name'];?>
" placeholder="角色名">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">描述</label>
						<div class="am-u-sm-9">
							<textarea name="role_des"><?php echo $_smarty_tpl->tpl_vars['user_info']->value['role_des'];?>
</textarea>
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">角色权限</label>
						<div class="am-u-sm-9">
							<table class="am-u-sm-12" border="1" cellpadding="2" style="border-color: #ccc;">
								<tbody>
								<?php  $_smarty_tpl->tpl_vars['act'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['act']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['action_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['act']->key => $_smarty_tpl->tpl_vars['act']->value) {
$_smarty_tpl->tpl_vars['act']->_loop = true;
?>
									<tr>
										<td width="20%" style="padding-left:5px;">
											<input type="checkbox" name="action_list[]" value="<?php echo $_smarty_tpl->tpl_vars['act']->value['action_id'];?>
" <?php if ($_smarty_tpl->tpl_vars['act']->value['check']==1) {?> checked <?php }?> class="act_box act_par_<?php echo $_smarty_tpl->tpl_vars['act']->value['action_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['act']->value['action_list'];?>

										</td>
										<td style="padding-left:5px;">
										<?php  $_smarty_tpl->tpl_vars['kid'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['kid']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['act']->value['child']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['kid']->key => $_smarty_tpl->tpl_vars['kid']->value) {
$_smarty_tpl->tpl_vars['kid']->_loop = true;
?>
											<div style="float:left;width:30%;margin-bottom:3px;margin-top:3px;">
												<input type="checkbox" name="action_mod[]" value="<?php echo $_smarty_tpl->tpl_vars['kid']->value['mod_id'];?>
" <?php if ($_smarty_tpl->tpl_vars['kid']->value['check']==1) {?> checked <?php }?> class="act_box_<?php echo $_smarty_tpl->tpl_vars['act']->value['action_id'];?>
 act_child" data-id="<?php echo $_smarty_tpl->tpl_vars['act']->value['action_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['kid']->value['mod_name'];?>

											</div>
										<?php } ?>
										</td>						
									</tr>
								<?php } ?>
								</tbody>
							</table>
						</div>
					</div>
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<input type="hidden" name="id" value="<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
" />
							<button type="button" class="am-btn am-btn-primary hy-js-submit"><?php echo $_smarty_tpl->tpl_vars['_L']->value['SAVE'];?>
</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<?php echo $_smarty_tpl->getSubTemplate ('../Common/hy_footer.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

		<script type="text/javascript">
			hy_submit('index.php?g=admin&m=admin&a=<?php echo $_smarty_tpl->tpl_vars['action']->value;?>
');
		
			$(function(){
				$('.act_box').click(function(){
					var _this = $(this);
					var val = _this.val();
					var box = $('.act_box_'+val);
					var type = _this.attr("checked");
					box.each(function(){
						if(type == 'checked')
						{
							$(this).attr('checked', 'checked');	   
						}
						else
						{
							$(this).attr('checked', false);
						}
					});
				});
				
				$('.act_child').click(function(){
					var _this = $(this);
					var id = _this.attr("data-id");
					var box = $('.act_box_'+id);
					if(_this.attr('checked') == 'checked')
					{
						$('.act_par_'+id).attr('checked', 'checked');
					}
					else
					{
						var num = 0;
						box.each(function(){
							if($(this).attr('checked') == 'checked')
							{
								num++;
							}
						});
						
						if(num > 0)
						{
							$('.act_par_'+id).attr('checked', 'checked');
						}
						else
						{
							$('.act_par_'+id).attr('checked', false);
						}
					}
				});
			});
		</script>
	</body>

</html><?php }} ?>
